New function to get the cell renderers of a cell layout.
authorMatthias Clasen <mclasen@redhat.com>
Fri, 29 Dec 2006 07:53:01 +0000 (07:53 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 29 Dec 2006 07:53:01 +0000 (07:53 +0000)
2006-12-29  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtk.symbols:
        * gtk/gtkcelllayout.[hc] (gtk_cell_layout_get_cells):
        New function to get the cell renderers of a cell layout.

        * gtk/gtktreeviewcolumn.c:
        * gtk/gtkcellview.c:
        * gtk/gtkiconview.c: Implement get_cells.

ChangeLog
docs/reference/ChangeLog
docs/reference/gtk/gtk-docs.sgml
docs/reference/gtk/gtk-sections.txt
gtk/gtk.symbols
gtk/gtkcelllayout.c
gtk/gtkcelllayout.h
gtk/gtkcellview.c
gtk/gtkiconview.c
gtk/gtktreeviewcolumn.c

index c46c786f05a92c776002efac7bc930a546cd0dea..ba0b2e0153aa982a03ad477c41f7f11d23e9bb99 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-12-29  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk.symbols:
+       * gtk/gtkcelllayout.[hc] (gtk_cell_layout_get_cells):
+       New function to get the cell renderers of a cell layout.
+
+       * gtk/gtktreeviewcolumn.c:
+       * gtk/gtkcellview.c:
+       * gtk/gtkiconview.c: Implement get_cells.
+
 2006-12-28  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkiconview.c: Use word wrapping by default, and
index 9b4e8b732c75c59efb7c07f4ef6c0fd47f12bb77..93be8c442e135426231a997e319ee61783015bd3 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-29  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtk-sections.txt: Add gtk_cell_layout_get_cells.
+
+       * gtk/gtk-docs.sgml: Add a "Since 2.12" index.
+
 2006-12-22  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk/gdk-sections.txt: Add new functions.
index 7d6569982531ec70a8956ae779b143dc02893311..87c9f2bd58b20fdb2112d581dffa8097c669559f 100644 (file)
@@ -671,5 +671,8 @@ that is, GUI components such as <link linkend="GtkButton">GtkButton</link> or
   <index role="2.10">
     <title>Index of new symbols in 2.10</title>
   </index>  
+  <index role="2.12">
+    <title>Index of new symbols in 2.12</title>
+  </index>  
 
 </book>
index 8b58ed4a421ba840bf748d8c57f074401e0ed5a5..258df39efc344ace35aa44bb344743abe9f732ad 100644 (file)
@@ -4574,6 +4574,7 @@ GtkCellLayoutIface
 GtkCellLayoutDataFunc
 gtk_cell_layout_pack_start
 gtk_cell_layout_pack_end
+gtk_cell_layout_get_cells
 gtk_cell_layout_reorder
 gtk_cell_layout_clear
 gtk_cell_layout_set_attributes
index 573137fd9fea15b51f81c88100eeb07af90f56c0..e4b382f1c1fbf68ee34fbcb4ff8ea78c0a8885da 100644 (file)
@@ -498,6 +498,7 @@ gtk_cell_layout_clear_attributes
 gtk_cell_layout_get_type G_GNUC_CONST
 gtk_cell_layout_pack_end
 gtk_cell_layout_pack_start
+gtk_cell_layout_get_cells
 gtk_cell_layout_reorder
 gtk_cell_layout_set_attributes G_GNUC_NULL_TERMINATED
 gtk_cell_layout_set_cell_data_func
index e866271a44fe9c1b6758bbb6b894c5d41ec857a5..10cf3c426759c673d397d910eb6b0f411f7c4841 100644 (file)
@@ -283,5 +283,31 @@ gtk_cell_layout_reorder (GtkCellLayout   *cell_layout,
                                                         position);
 }
 
+/**
+ * gtk_cell_layout_get_cells:
+ * @cell_layout: a #GtkCellLayout
+ * 
+ * Returns the cell renderers which have been added to @cell_layout.
+ *
+ * Return value: a list of cell renderers. The list, but not the
+ *   renderers has been newly allocated and should be freed with
+ *   g_list_free() when no longer needed.
+ * 
+ * Since: 2.12
+ */
+GList *
+gtk_cell_layout_get_cells (GtkCellLayout *cell_layout)
+{
+  GtkCellLayoutIface *iface;
+
+  g_return_val_if_fail (GTK_IS_CELL_LAYOUT (cell_layout), NULL);
+
+  iface = GTK_CELL_LAYOUT_GET_IFACE (cell_layout);  
+  if (iface->get_cells)
+    return iface->get_cells (cell_layout);
+
+  return NULL;
+}
+
 #define __GTK_CELL_LAYOUT_C__
 #include "gtkaliasdef.c"
index 3b4d375a597d7b5a2f7ebf7ea42b4a301180d303..520f35dbc1af68620cdbc230f7dbc6890004e413 100644 (file)
@@ -68,6 +68,7 @@ struct _GtkCellLayoutIface
   void (* reorder)            (GtkCellLayout         *cell_layout,
                                GtkCellRenderer       *cell,
                                gint                   position);
+  GList* (* get_cells)        (GtkCellLayout         *cell_layout);
 };
 
 GType gtk_cell_layout_get_type           (void) G_GNUC_CONST;
@@ -77,6 +78,7 @@ void  gtk_cell_layout_pack_start         (GtkCellLayout         *cell_layout,
 void  gtk_cell_layout_pack_end           (GtkCellLayout         *cell_layout,
                                           GtkCellRenderer       *cell,
                                           gboolean               expand);
+GList *gtk_cell_layout_get_cells         (GtkCellLayout         *cell_layout);
 void  gtk_cell_layout_clear              (GtkCellLayout         *cell_layout);
 void  gtk_cell_layout_set_attributes     (GtkCellLayout         *cell_layout,
                                           GtkCellRenderer       *cell,
index 405a8ba0ad2bf222344498bfb33fa62474d5370f..1cd3fc7065498f7a15d5216ff6444c35f5b44591 100644 (file)
@@ -103,7 +103,7 @@ static void       gtk_cell_view_cell_layout_set_cell_data_func (GtkCellLayout
 static void       gtk_cell_view_cell_layout_reorder            (GtkCellLayout         *layout,
                                                                 GtkCellRenderer       *cell,
                                                                 gint                   position);
-
+static GList *    gtk_cell_view_cell_layout_get_cells          (GtkCellLayout         *layout);
 
 #define GTK_CELL_VIEW_GET_PRIVATE(obj)    (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_VIEW, GtkCellViewPrivate))
 
@@ -184,6 +184,7 @@ gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface)
   iface->set_cell_data_func = gtk_cell_view_cell_layout_set_cell_data_func;
   iface->clear_attributes = gtk_cell_view_cell_layout_clear_attributes;
   iface->reorder = gtk_cell_view_cell_layout_reorder;
+  iface->get_cells = gtk_cell_view_cell_layout_get_cells;
 }
 
 static void
@@ -1060,5 +1061,12 @@ gtk_cell_view_get_cell_renderers (GtkCellView *cell_view)
   return g_list_reverse (retval);
 }
 
+static GList *
+gtk_cell_view_cell_layout_get_cells (GtkCellLayout *layout)
+{
+  return gtk_cell_view_get_cell_renderers (GTK_CELL_VIEW (layout));
+}
+
+
 #define __GTK_CELL_VIEW_C__
 #include "gtkaliasdef.c"
index 218e653f930839db4bf1398549499c580a6dd5f6..f7ecd435f82a0d599d8a441a4bcc588a1c612cf2 100644 (file)
@@ -383,6 +383,8 @@ static void                 gtk_icon_view_cell_layout_set_cell_data_func (GtkCel
 static void                 gtk_icon_view_cell_layout_reorder            (GtkCellLayout          *layout,
                                                                          GtkCellRenderer        *cell,
                                                                          gint                    position);
+static GList *              gtk_icon_view_cell_layout_get_cells          (GtkCellLayout          *layout);
+
 static void                 gtk_icon_view_item_activate_cell             (GtkIconView            *icon_view,
                                                                          GtkIconViewItem        *item,
                                                                          GtkIconViewCellInfo    *cell_info,
@@ -893,6 +895,7 @@ gtk_icon_view_cell_layout_init (GtkCellLayoutIface *iface)
   iface->set_cell_data_func = gtk_icon_view_cell_layout_set_cell_data_func;
   iface->clear_attributes = gtk_icon_view_cell_layout_clear_attributes;
   iface->reorder = gtk_icon_view_cell_layout_reorder;
+  iface->get_cells = gtk_icon_view_cell_layout_get_cells;
 }
 
 static void
@@ -4375,6 +4378,22 @@ gtk_icon_view_cell_layout_reorder (GtkCellLayout   *layout,
   gtk_widget_queue_draw (GTK_WIDGET (icon_view));
 }
 
+static GList *
+gtk_icon_view_cell_layout_get_cells (GtkCellLayout *layout)
+{
+  GtkIconView *icon_view = (GtkIconView *)layout;
+  GList *retval = NULL, *l;
+
+  for (l = icon_view->priv->cell_list; l; l = l->next)
+    {
+      GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
+
+      retval = g_list_prepend (retval, info->cell);
+    }
+
+  return g_list_reverse (retval);
+}
+
 /* Public API */
 
 
index 69cd5f7fb59ba993e6f276cffc30b4cba6300c9d..6904c6f38a3e9268feff5d46fd9530f5b517fd37 100644 (file)
@@ -112,6 +112,7 @@ static void gtk_tree_view_column_cell_layout_clear_attributes   (GtkCellLayout
 static void gtk_tree_view_column_cell_layout_reorder            (GtkCellLayout         *cell_layout,
                                                                  GtkCellRenderer       *cell,
                                                                  gint                   position);
+static GList *gtk_tree_view_column_cell_layout_get_cells        (GtkCellLayout         *cell_layout);
 
 /* Button handling code */
 static void gtk_tree_view_column_create_button                 (GtkTreeViewColumn       *tree_column);
@@ -332,6 +333,7 @@ gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface)
   iface->set_cell_data_func = gtk_tree_view_column_cell_layout_set_cell_data_func;
   iface->clear_attributes = gtk_tree_view_column_cell_layout_clear_attributes;
   iface->reorder = gtk_tree_view_column_cell_layout_reorder;
+  iface->get_cells = gtk_tree_view_column_cell_layout_get_cells;
 }
 
 static void
@@ -1552,6 +1554,12 @@ gtk_tree_view_column_get_cell_renderers (GtkTreeViewColumn *tree_column)
   return retval;
 }
 
+static GList *
+gtk_tree_view_column_cell_layout_get_cells (GtkCellLayout *layout)
+{
+  return gtk_tree_view_column_get_cell_renderers (GTK_TREE_VIEW_COLUMN (layout));
+}
+
 /**
  * gtk_tree_view_column_add_attribute:
  * @tree_column: A #GtkTreeViewColumn.